<!DOCTYPE html>
<html>
<head lang="en">
  <meta charset="UTF-8">
  <title>${title}</title>
  <link rel="icon" href="${base}/images/favicon.ico" type="/image/x-icon" />
	<link rel="stylesheet" href="${base}/css/common.css">
    <link rel="stylesheet" href="${base}/css/admin.css">
    <script type="text/javascript" src="${base}/js/common.js"></script>
    <link rel="stylesheet" href="${base}/css/page.css">
	<script src="${base}/js/jquery-1.7.2.min.js" ></script>
	<script src="${base}/js/jquery.jqpagination.min.js" ></script>	
    <base href="${base}/admin/">
    <style>
    	.button{border-radius: 4px;display: inline-block;width: 100px;height: 25px;text-align: center;font-size: 14px;border: 0;color: #fff;background-color: #337ab7;transition: all .2s ease-in-out;text-shadow: 0 1px 3px rgba(0,0,0,.4),0 0 30px rgba(0,0,0,.075);}
    </style>
</head>
<body>
<#include "/common/admin_left${type}.flt">
<div class="main">
    <div class="head">
        <div class="title" style="width: 100%;"><p>订单列表  <label style="margin-left: 20%;">服务人员</label> 
        <select name="sid" id ="sid">
        	<#list suserList as one>
        	<option value="${one.id}">${one.account} ${one.name}</option>
        	</#list>
        </select>
         <input type="button" style="margin-left: 10%;" id="pass" value="批量派单" class="button" onclick="pass();" />  </p></div>
    </div>
    <div class="search"  >
        <form action="orderList"  method="post" >
        	<input type="text"    name="orderid"  id="orderid" value="${orderid}" placeholder="订单号"/>
        	<input type="hidden"    name="page"  id="page" value="${page.pageNumber}" />
            <input type="submit"  id="sub"  class="sub"  value="查询" />
        </form>
    </div>
    <div class="table project">
        <div class="hh">
        	<div class="th w15"><input type="checkbox" id="all">全选 订单号</div>
        	<div class="th w9">下单时间</div>
<!--         	<div class="th w9">入驻时间</div> -->
        	<div class="th w9">退房时间</div>
        	<div class="th w9">最迟退房时间</div>
			<div class="th w4">价格</div>
			<div class="th w4">房源id</div>
			<div class="th w6">管家公号</div>
            <div class="th w6">未打扫照片</div>
            <div class="th w6">打扫后照片</div>
            <div class="th w4">状态</div>
            <div class="th w9">备注</div>
            <div class="th w9">评价</div>
            <div class="th w6">操作</div>
        </div>
        <#list page.list as one>
		<div class="tr">
            <div class="td w15"><input type="checkbox" name="id" value="${one.id}"> ${one.orderid}</div>
			<div class="td w9">${one.createtime1}</div>
<!-- 			<div class="td w9">${one.checkintime1}</div> -->
			<div class="td w9">${one.checkouttime1}</div>
			<div class="td w9">${one.endtime1}</div>
			<div class="td w4">${one.price}</div>
			<div class="td w4"  title="房源：${one.hname}"><a href="house?id=${one.hid}">${one.hid}</a> </div>
			<div class="td w6">${one.account}</div>
			<div class="td w6" title="未打扫照片"><a href ="view?value=${one.bpic}" target="_blank">照片</a></div>
			<div class="td w6" title="打扫后照片"><a href ="view?value=${one.apic}" target="_blank" >照片</a></div>
			<div class="td w4">${one.statusname}</div>
			<div class="td w9" title="${one.note}">${one.note}</div>
			<div class="td w9" title="${one.comment}">${one.comment}</div>
            <div class="td w6" title=${one.note} ><a href="order?id=${one.id}" target="_blank">修改</a><!--|| <a onclick="del('${one.id}');">删除</a>  --> </div>
	    </div>
	     
	    <!-- end tr -->
		</#list>
	</div><!-- end table project -->
	<#include "/common/page.flt">
</div>	<!-- end table main -->
</body>
<script>
$(document).ready(function() {
	$('.pagination').jqPagination({
		link_string	: 'javascript:void(0);',
		current_page: ${page.pageNumber},
		max_page	: ${page.totalPage},
		page_string : '当前第${page.pageNumber}页,共${page.totalPage}页',
		paged		: function(page) {
			$("#page").val(page);
			$("#sub").click();
		}
	});
	
	$("#all").click(function (){
		if ($(this).attr("checked")) { 
			$("input[type='checkbox']").attr("checked","checked");
		} else {
			$("input[type='checkbox']").removeAttr("checked");
		}
	});
});

function del(id){
	$.ajax({ url: "configDel?id="+id, success: function(data){
		alert(data);
		window.location.reload();
     }});
}
function pass(){
	var values = "";
	var i = 0;
	$("input[name='id']").each(function(){
		if ($(this).attr("checked")){
			values = values + $(this).attr("value") +",";
			i = i+1;
		}
	});
	if (i > 0){
		values = values +"0";
		var sid = $("#sid").val();
		$.ajax({
	        url: "dispatch?ids="+values+"&sid="+sid,
	        type: "get",
	        dataType:"text",
	        success: function (data) {
	        	alert(data);
	        	$("#sub").click();
	        }
		});
	}
}

</script>
</html>
